package sanshui.system.trade.service;

import sanshui.system.trade.common.TradeType;
import sanshui.system.trade.db.entity.TradeWorker;
import sanshui.system.trade.factory.trade.worker.AbstractTradeWorker;
import sanshui.system.trade.model.TradeReportModel;
import sanshui.system.trade.model.TradeWorkerModel;

import java.util.List;
import java.util.Map;

public interface IWorkerService {

    String insertBackTradeWorkerIfDefault(TradeWorkerModel tradeWorkerModel);

    boolean buildBackTradeWorker(TradeWorkerModel tradeWorkerModel);

    TradeWorkerModel buildWorkerModel(Long workerId);
    TradeReportModel selectWorkerReportById(Long workerId);
    List<TradeWorkerModel> selectWorkerList(TradeWorkerModel workerModel);

    TradeWorkerModel selectWorkerModelById(Long workerId);
    TradeWorker selectWorkerById(Long workerId);
    List<TradeWorker> selectWorkerByAccId(Long accId);
    List<TradeWorkerModel> selectWorkers(TradeType.WorkerStatus workerStatus);

    List<Long> selectWorkersIdByStatus(TradeType.WorkerStatus workerStatus);

    int updateWorkerStatusByWorkerId(Long workerId, TradeType.WorkerStatus workerStatus, TradeType.WorkerStatus oldStatus);

    int updateWorkerByWorkerId(Long workerId, TradeWorker tradeWorker);

    void deleteWorkerById(Long workerId);

    String runRtWorker(String workerId);

    void clearWorker(String clearTime);

    void checkTaskIfRunInMap(Map<Long, AbstractTradeWorker> workerMap);
}
